import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class ConcurrentModificationExceptionTest {
	public static void main(String[] args) {
		testError1();
	}

	private static void testError() {
		Map<String,String> sqlMap =new HashMap<String, String>();
		for(int i=0;i<100000;i++){
			sqlMap.put(""+i, ""+i);
		}
		Iterator<String> it = null;
		it = sqlMap.keySet().iterator();
		while(it.hasNext()) {
			String key=it.next();
			sqlMap.put(key, key+"a");
			sqlMap.put(key+"a", key+"a");
			System.out.print(key);
			System.out.println(sqlMap.get(key));
		}
	}
	private static void testError1() {
		Map<String,String> sqlMap =new HashMap<String, String>();
		for(int i=0;i<100000;i++){
			sqlMap.put(""+i, ""+i);
		}
		for(String key: sqlMap.keySet()) {
			sqlMap.put(key, key+"a");
			sqlMap.put(key+"a", key+"a");
			System.out.print(key);
			System.out.println(sqlMap.get(key));
		}
	}
}
